/*
 * Copyright (c) 2017. 杭州端点网络科技有限公司.  All rights reserved.
 */

package com.jiantong.web.core.cloud.config;

import com.jiantong.web.core.cloud.service.impl.AliyunFileServer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : panxin
 */
@Configuration
public class AliyunOSSConfiguration {

    @Bean
    public AliyunToken aliyunToken() {
        return new AliyunToken();
    }

    @Bean
    public AliyunFileServer aliyunFileServer(@Value("${oss.endpoint}") String endpoint,
                                             @Value("${oss.secretId}") String secretId,
                                             @Value("${oss.secretKey}") String secretKey,
                                             @Value("${oss.bucketName}") String bucketName) {
        return new AliyunFileServer(endpoint, secretId, secretKey, bucketName);
    }

}
